﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace LoveEat.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class goodsone : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "aquacultures",
                columns: table => new
                {
                    AquacultureId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    variety = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Days = table.Column<int>(type: "int", nullable: false),
                    Brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manager = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Releasedate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Farm = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Charge = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Numberstock = table.Column<int>(type: "int", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_aquacultures", x => x.AquacultureId);
                });

            migrationBuilder.CreateTable(
                name: "comps",
                columns: table => new
                {
                    CompId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ComName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ComAdds = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ComTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ComInt = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_comps", x => x.CompId);
                });

            migrationBuilder.CreateTable(
                name: "deeps",
                columns: table => new
                {
                    DeepId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Team = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    charge = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ComName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Pronumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_deeps", x => x.DeepId);
                });

            migrationBuilder.CreateTable(
                name: "goods",
                columns: table => new
                {
                    GoodsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsNameId = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    LifeDay = table.Column<int>(type: "int", nullable: false),
                    Pronumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProCommand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Information = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false),
                    AquacultureId = table.Column<int>(type: "int", nullable: false),
                    slaughterId = table.Column<int>(type: "int", nullable: false),
                    DeepId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods", x => x.GoodsId);
                });

            migrationBuilder.CreateTable(
                name: "goodsName",
                columns: table => new
                {
                    GoodsNameId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsNameName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goodsName", x => x.GoodsNameId);
                });

            migrationBuilder.CreateTable(
                name: "healths",
                columns: table => new
                {
                    HealthId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Days = table.Column<int>(type: "int", nullable: false),
                    HealthType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthMethod = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_healths", x => x.HealthId);
                });

            migrationBuilder.CreateTable(
                name: "paths",
                columns: table => new
                {
                    PathId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PathType = table.Column<int>(type: "int", nullable: false),
                    RelateId = table.Column<int>(type: "int", nullable: false),
                    PathName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    PathUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_paths", x => x.PathId);
                });

            migrationBuilder.CreateTable(
                name: "slaughters",
                columns: table => new
                {
                    slaughterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    weight = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    KillTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_slaughters", x => x.slaughterId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "aquacultures");

            migrationBuilder.DropTable(
                name: "comps");

            migrationBuilder.DropTable(
                name: "deeps");

            migrationBuilder.DropTable(
                name: "goods");

            migrationBuilder.DropTable(
                name: "goodsName");

            migrationBuilder.DropTable(
                name: "healths");

            migrationBuilder.DropTable(
                name: "paths");

            migrationBuilder.DropTable(
                name: "slaughters");
        }
    }
}
